﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Basis.ViewModel;
using Tanmia.Core;
using Tanmia.Domain;
using System.ComponentModel;
using System.Windows.Data;

namespace Tanmia.Windows.ItemScenario
{
    public class ItemViewModel : BaseViewModel<Item>
    {
        public ICollectionView Categories { get; private set; }

        private ItemCategoryDomain ItemCategoryObj = new ItemCategoryDomain();

        public ItemViewModel()
            : base(new ItemDomain())
        {
            Categories = CollectionViewSource.GetDefaultView(ItemCategoryObj.GetsWithSelect());
        }

        public void UpdateCategories()
        {
            Categories = CollectionViewSource.GetDefaultView(ItemCategoryObj.GetsWithSelect());

            RaisePropertyChanged("Categories");
        }
    }
}
